# -*- coding: utf-8 -*-
# @Time    : 2019/12/29 17:39
# @Author  : Weymouth
# @Email   : 261229090@qq.com
# @File    : lesson_file.py
# @Software: PyCharm
# ---------------------------------------------------

# path = r"E:\test_platform\study\day8\小重山"
# f = open(path, 'a', encoding='utf8')
# 能调用方法的一定是对象

# li = [1, 2, 3]
# li.append('2')
# 'asc'.capitalize()

#
# data = f.read(5)
# print(data)
# f.close()

# for i in f: #这是for内部将f对象做成一个迭代器，用一行取一行。
#     print(i.strip())
# print(f.tell())
# print(f.read(1))
# print(f.tell())
# f.seek(0)   #可用于断点续传
# print(f.read(4))

# f.flush()   #可用于进度条，将缓存数据写入磁盘
# f.close()

# import sys,time
# for i in range(30):
#     sys.stdout.write("*")
#     sys.stdout.flush()
#     time.sleep(0.1)

# import  sys,time
# for i in range(30):
#     print('*', end='', flush=True)
#     time.sleep(0.1)
path = r"E:\test_platform\study\day8\小重山"
f = open(path, 'a', encoding='utf8')
f.truncate(5)    #截断

f.close()

#终极问题
